//
//  MainViewController.swift
//  GuMro
//
//  Created by mac on 2019/12/4.
//  Copyright © 2019 cn.gomro.app. All rights reserved.
//

import UIKit

/**
 * 图像绘制
 * https://www.jianshu.com/p/ba721bf02446
 */
class MainViewController: BaseViewController {
    
    
    //MARK: - override
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }
    
    override func layoutNavigation() {

    }
    
    override func bindViewModel() {

    }
    
    override func addSubViews() {
        self.view.addSubview(self.mainView)
        self.view.backgroundColor = Setting.K_APP_VIEWCONTROLLER_BACKGROUND_COLOR
    }
    
    override func updateViewConstraints() {
        
        self.mainView.snp.makeConstraints { make in
            make.left.right.equalTo(0)
            make.top.equalTo(0)
            if UIDevice.current.getFloatSystemVersion() < 11.0 {
                make.top.equalTo(-20)
            }
            make.bottom.equalTo(-Setting.K_APP_TABBAR_HEIGHT)
        }
        
        super.updateViewConstraints()
    }
    
    
    //MARK: - lazy load
    private lazy var mainView:MainView = {
        return MainView.init(ViewModel: self.viewModel)
    }()
    
    private lazy var viewModel:MainViewModel = {
        return MainViewModel.init()
    }()
}
